#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QStackedWidget>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include "database.h"
#include "bookmanagement.h"
#include "userinfo.h"

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(const QString &username, Database *db, QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void onBookManagementClicked();
    void onUserInfoClicked();
    void onLogoutClicked();

private:
    void setupUI();
    void createConnections();

    QString username;
    Database *db;
    QWidget *centralWidget;
    QVBoxLayout *mainLayout;
    QStackedWidget *stackedWidget;
    QPushButton *bookManagementButton;
    QPushButton *userInfoButton;
    QPushButton *logoutButton;
    BookManagement *bookManagement;
    UserInfo *userInfo;
};

#endif // MAINWINDOW_H 
